package com.antoco.operation.bigscreen.repository;

import com.antoco.operation.bigscreen.model.entity.TjZt;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TjZtRepository extends PagingAndSortingRepository<TjZt, String> {

    /**
     * 根据表名查询统计主题
     *
     * @param tableName
     * @return
     */
    @Query(value = "SELECT * FROM tj_zt WHERE tj_ins_detail_table_name = ?1 ORDER BY id DESC", nativeQuery = true)
    List<TjZt> findByTjInsDetailTableName(String tableName);
}